package com.yhq.spring.websocket.controller;

import com.yhq.spring.web.controller.PlainResult;
import com.yhq.spring.websocket.service.STVoiceParserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hqyin
 * @date 2024/11/25 3:25 PM
 */
@RestController
@Slf4j
public class STVoiceParserController {
    @Autowired
    private STVoiceParserService stVoiceParserService;
    /**
     * 根据语音文件地址解析
     * @param path
     * @return
     */
    @GetMapping("/parseVoice")
    public PlainResult parseVoice(@RequestParam String path) {
        String result =  stVoiceParserService.parseVoice(path);
        return PlainResult.success(result);
    }
}
